var createError = require('http-errors')
var fs = require("fs")
fs.readFile('foo.txt', function (err, buf) {
    if (err) {
      if (err.code === 'ENOENT') {
        var httpError = createError(404, err, { expose: false })
        console.log("httpError: ", httpError)
      } else {
        var httpError = createError(500, err)
        console.log("err", httpError)
      }
    }
  })